﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SqlCe4Mvc3Application1.Models
{
    public partial class _Containers_ContainerWidgetPartRecord : RaisingStudio.Data.Expressions.TableExpression, RaisingStudio.Data.Expressions.IQueryExpression<_Containers_ContainerWidgetPartRecord>
    {
        #region Constructor (s) / Destructor
        /// <summary>
        /// Constructor (s) / Destructor.
        /// </summary>
        public _Containers_ContainerWidgetPartRecord() : base("Containers_ContainerWidgetPartRecord")
        {
        }
        #endregion
        #region Members
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Id = "Id";
        public RaisingStudio.Data.Expressions.ColumnExpression Id { get { return _Id; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _ContainerId = "ContainerId";
        public RaisingStudio.Data.Expressions.ColumnExpression ContainerId { get { return _ContainerId; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _PageSize = "PageSize";
        public RaisingStudio.Data.Expressions.ColumnExpression PageSize { get { return _PageSize; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _OrderByProperty = "OrderByProperty";
        public RaisingStudio.Data.Expressions.ColumnExpression OrderByProperty { get { return _OrderByProperty; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _OrderByDirection = "OrderByDirection";
        public RaisingStudio.Data.Expressions.ColumnExpression OrderByDirection { get { return _OrderByDirection; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _ApplyFilter = "ApplyFilter";
        public RaisingStudio.Data.Expressions.ColumnExpression ApplyFilter { get { return _ApplyFilter; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _FilterByProperty = "FilterByProperty";
        public RaisingStudio.Data.Expressions.ColumnExpression FilterByProperty { get { return _FilterByProperty; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _FilterByOperator = "FilterByOperator";
        public RaisingStudio.Data.Expressions.ColumnExpression FilterByOperator { get { return _FilterByOperator; } }
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _FilterByValue = "FilterByValue";
        public RaisingStudio.Data.Expressions.ColumnExpression FilterByValue { get { return _FilterByValue; } }

		#endregion

        public static implicit operator RaisingStudio.Data.Expressions.ConditionExpression(_Containers_ContainerWidgetPartRecord Containers_ContainerWidgetPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ConditionExpression();
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression)
        {
             RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
             return conditionExpression.OrderBy(columnExpression);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression, RaisingStudio.Data.Expressions.SortingDirection sortingDirection)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.OrderBy(columnExpression, sortingDirection);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression Where(RaisingStudio.Data.Expressions.ExpressionElement expressionElement)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.Where(expressionElement);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpressionCollection(_Containers_ContainerWidgetPartRecord Containers_ContainerWidgetPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpressionCollection(Containers_ContainerWidgetPartRecord);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpression[](_Containers_ContainerWidgetPartRecord Containers_ContainerWidgetPartRecord)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpression[]
                        {                            
                            Containers_ContainerWidgetPartRecord.Id,
                            Containers_ContainerWidgetPartRecord.ContainerId,
                            Containers_ContainerWidgetPartRecord.PageSize,
                            Containers_ContainerWidgetPartRecord.OrderByProperty,
                            Containers_ContainerWidgetPartRecord.OrderByDirection,
                            Containers_ContainerWidgetPartRecord.ApplyFilter,
                            Containers_ContainerWidgetPartRecord.FilterByProperty,
                            Containers_ContainerWidgetPartRecord.FilterByOperator,
                            Containers_ContainerWidgetPartRecord.FilterByValue,
                        };
        }

        public RaisingStudio.Data.Expressions.ColumnExpressionCollection Except(params RaisingStudio.Data.Expressions.ColumnExpression[] columns)
        {
            RaisingStudio.Data.Expressions.ColumnExpressionCollection columnExpressionCollection = this;
            return columnExpressionCollection.Except(columns);
        }

    
        public static implicit operator RaisingStudio.Data.Expressions.QueryExpression<_Containers_ContainerWidgetPartRecord>(_Containers_ContainerWidgetPartRecord Containers_ContainerWidgetPartRecord)
        {
            return new RaisingStudio.Data.Expressions.QueryExpression<_Containers_ContainerWidgetPartRecord>(Containers_ContainerWidgetPartRecord);
        }


        #region IQueryExpression<_Containers_ContainerWidgetPartRecord> 成员

        _Containers_ContainerWidgetPartRecord RaisingStudio.Data.Expressions.IQueryExpression<_Containers_ContainerWidgetPartRecord>.Value
        {
            get { return Containers_ContainerWidgetPartRecord._; }
        }

        #endregion

        #region IQueryExpression 成员

        RaisingStudio.Data.Expressions.TableExpression RaisingStudio.Data.Expressions.IQueryExpression.Table
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ConditionExpression RaisingStudio.Data.Expressions.IQueryExpression.Condition
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ColumnExpressionCollection RaisingStudio.Data.Expressions.IQueryExpression.Columns
        {
            get { return null; }
        }

        #endregion
    }

    partial class Containers_ContainerWidgetPartRecord
    {
        #region Members
        public static readonly _Containers_ContainerWidgetPartRecord _ = new _Containers_ContainerWidgetPartRecord();
		#endregion
    }
}
